package com.ruo.goods.controller;

import com.ruo.common.core.domain.R;
import com.ruo.goods.domain.PmsBrand;
import com.ruo.goods.domain.PmsProductCategory;
import com.ruo.goods.service.PmsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author：尚志豪
 * @Package：com.ruo.goods.controller
 * @Project：ruoi
 * @name：PmsBrandController
 * @Date：2024/7/21 10:30
 */
@RestController
@RequestMapping("/pmsBrand")
public class PmsBrandController {
    @Autowired
    private PmsBrandService pmsBrandService;

    /**
     * 商品品牌列表
     */
    @PostMapping("/pmsBrandList")
    private R<List<PmsBrand>> pmsBrandList(){
        List<PmsBrand> list = pmsBrandService.pmsBrandList();
        return R.ok(list);
    }

    /**
     * 商品品牌添加
     */
    @PostMapping("/pmsBrandAdd")
    public R pmsBrandAdd(@RequestBody PmsBrand pmsBrand){
        R r = pmsBrandService.pmsBrandAdd(pmsBrand);
        return r;
    }

    /**
     * 商品品牌删除
     */
    @PostMapping("/pmsBrandDel")
    public R pmsBrandDel(@RequestParam Integer id){
        R r = pmsBrandService.pmsBrandDel(id);
        return r;
    }
    /**
     * 商品品牌修改
     */
    @PostMapping("/pmsBrandUpdate")
    public R pmsBrandUpdate(@RequestBody PmsBrand pmsBrand){
        R r = pmsBrandService.pmsBrandUpdate(pmsBrand);
        return r;
    }
    /**
     * 商品品牌回显
     */
    @PostMapping("/pmsBrandEcho")
    public R<PmsBrand> pmsBrandEcho(@RequestParam Integer id){
        PmsBrand r = pmsBrandService.pmsBrandEcho(id);
        return R.ok(r);
    }
}
